// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.modules.dao.impl;

import com.liuxinlong.modules.dao.PatentRiskDao;
import com.liuxinlong.modules.entity.PatentRisk;
import com.liuxinlong.modules.mapper.PatentRiskMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 类描述
 * <p>
 * 此类关联设计的功能
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2024年3月18日
 */
@Service
public class PatentRiskDaoImpl extends ServiceImpl<PatentRiskMapper, PatentRisk>
        implements PatentRiskDao {

    @Override
    public List<PatentRisk> pagePatentRiskList(Map<String, Object> queryParam) {
        return baseMapper.pagePatentRiskList(queryParam);
    }

    @Override
    public int getPatentRiskCount(Map<String, Object> queryParam) {
        return baseMapper.getPatentRiskCount(queryParam);
    }

    @Override
    public List<PatentRisk> getPatentRiskList() {
        return baseMapper.getPatentRiskList();
    }

    @Override
    public Map<String, Map<String, String>> getPatentRiskMap() {
        return baseMapper.getPatentRiskMap();
    }

    @Override
    public Map<String, PatentRisk> getProjectPatentRiskMap(String projectId) {
        Map<String,Object> queryParam = new HashMap<>();
        queryParam.put("projectId",projectId);
        queryParam.put("startNum",0);
        queryParam.put("pageSize",10000);
        List<PatentRisk> riskList = baseMapper.pagePatentRiskList(queryParam);
        Map<String, PatentRisk> riskMap = new HashMap<>();
        for (PatentRisk risk : riskList) {
            riskMap.put(risk.getId(),risk);
        }
        return riskMap;
    }

    @Override
    public List<PatentRisk> getAvailablePatentRiskList(String projectId) {
        return baseMapper.getAvailablePatentRiskList(projectId);
    }

    @Override
    public List<PatentRisk> getProcessPatentRiskList(String projectId, int processNode) {
        return baseMapper.getProcessPatentRiskList(projectId,processNode);
    }
}
